1. Field
The present invention relates to a policer device and a bandwidth control.
2. Description of the Related Art
In recent years, for example, in a relay device such as a layer 2 switch (hereinafter, “L2 switch”), quality of service (QoS) control that controls the priority of frame relay depending on the quality required for frames to be relayed is sometimes carried out. In such a relay device, as disclosed, for example, in Japanese Patent Application Laid-open Publication No. 2006-173726, policers that carry out polishing on an input side and shapers that carry out shaping on an output side are sometimes provided.
FIG. 9 is a block diagram of a schematic configuration of a common L2 switch provided with policers and shapers. The L2 switch shown in FIG. 9 is provided with n ports (n is an integer equal to or larger than two) and has classifying units 10-1 to 10-n, policers 20-1 to 20-n, and shapers 40-1 to 40-n corresponding to the respective ports.
Input frames input from the respective ports of the L2 switch are classified into classes by the respective classifying units 10-1 to 10-n according to the priority and output to the respective policers 20-1 to 20-n. The frames are bandwidth controlled by the respective policers 20-1 to 20-n and output to a switching unit 30. At this time, the policers 20-1 to 20-n are supplied with resources generally called token or the like for bandwidth control with a predetermined period. Each of the policers 20-1 to 20-n performs bandwidth control according to classes of the frames by outputting the frames in the range of accumulated resources while consuming the resources.
The frames output from the policers 20-1 to 20-n are output by the switching unit 30 to the shapers 40-1 to 40-n that correspond to the respective ports according to the respective destination addresses of the frames and bandwidth controlled by the respective shapers 40-1 to 40-n, followed by being output as output frames from the respective ports.
Generally, a plurality of policers provided in a relay device are supplied with resources for bandwidth control with the respective independent periods. That is, for example, in the L2 switch shown in FIG. 9, the policers 20-1 to 20-n are supplied with resources at their timings different from one another. In addition, when a frame is output from any of the policers, resources for the other policers are consumed, which gives rise to a problem that only part of the policers always pass frames depending on the difference in resource supply timings.
Specifically, for example, in FIG. 9, when a resource supply timing for the policer 20-1 is earlier than those for the other policers 20-2 to 20-n, the policer 20-1 monopolizes resources prior to the resource supply timings for the other policers 20-2 to 20-n. Moreover, when the policer 20-1 consumes a large amount of resources while monopolizing the resources, the amount of the resources for the policers 20-2 to 20-n drops to smaller than zero before the resource supply timings for the policers 20-2 to 20-n come, and unless the amount of the resources for the policers 20-2 to 20-n recovers to equal to or larger than zero even when resources are supplied at their resource supply timings, the policers 20-2 to 20-n cannot pass any frames.
After this, when the next resource supply timing for the policer 20-1 comes, the policer 20-1 again monopolizes the resources and passes a frame, thereby exhausting the resources that the other policers 20-2 to 20-n are supposed to be able to consume. Because of the exhaustion of the resources, the policers 20-2 to 20-n have to discard frames, whereas the policer 20-1 monopolizes the resources newly supplied and passes new frames one after another.
In this way, since a resource supply timing for each policer is independent, the fairness to frame passing is not insured. Even though users who transmit frames pay for the same charge to their communications services corporation, the same bandwidth is sometimes not ensured in the relay device.